package com.ruitu.mall_98_2.mvp.presenter;

import com.beanu.arad.utils.ToastUtils;
import com.ruitu.mall_98_2.mvp.contract.CheckLogisticsContract;
import com.ruitu.router_module.bean.api.BaseResult;
import com.ruitu.router_module.bean.api.SubscriberImpl;

public class CheckLogisticsPresenter extends CheckLogisticsContract.Presenter {
    @Override
    public void getOrderTracesByJson(String odId) {
        mModel.getOrderTracesByJson(odId)
                .subscribe(new SubscriberImpl<BaseResult<String>>() {
                    @Override
                    public void onError(Throwable e) {
                        mView.hideProgress();
                        mView.setFaile();
                        ToastUtils.showShort("获取物流信息失败");
                    }

                    @Override
                    public void onNext(BaseResult<String> baseResult) {
                        mView.hideProgress();
                        if (baseResult.isSuccess()) {
                            mView.setSuc(baseResult.getData());
                        } else {

                        }
                    }
                });
    }
}
